package com.zpark.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.sql.SQLOutput;

@Controller
@RequestMapping("/thy")
public class ThymeleafController {
    @GetMapping("/text")
    public ModelAndView test(){
        //创建视图解析器
        ModelAndView mv = new ModelAndView();
        //设置视图名字
        mv.setViewName("text");
        //绑定数据
        mv.addObject("DC","Hello Thymeleaf");
        return mv;
    }


    @GetMapping("/par")
    public void myPar(String name,int age){
        //创建视图解析器
        ModelAndView mv = new ModelAndView();
        //设置视图名字
        mv.setViewName("demo03");
        //绑定数据

        System.err.println(name);
        System.err.println(age);

    }
}


